<?php

namespace App\Models\Operation;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class ContentTemplateType extends Model
{
    use SoftDeletes;

    public $table = 'content_template_types';

    protected $dates = ['deleted_at'];

    public $fillable = [
        // 内容模板类型名称
        'name',
        // 内容模板类型别名
        'alias',
        // 描述
        'description',
        // 排序
        'listorder',
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'name'        => 'string',
        'alias'       => 'string',
        'description' => 'string',
        'listorder'   => 'integer',
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        'name'      => 'required|max:100',
        'alias'     => 'required|max:100',
        'listorder' => 'required',
    ];
}
